/*
 *  This file is part of the SIRIUS libraries for analyzing MS and MS/MS data
 *
 *  Copyright (C) 2024 Bright Giant GmbH
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along with SIRIUS.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 *  https://openapi-generator.tech
 *  Do not edit the class manually.
 */


package io.sirius.ms.sdk.model;

import java.util.Objects;
import java.util.Arrays;
import java.util.Optional;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * SearchableDatabase
 */
@JsonPropertyOrder({
  SearchableDatabase.JSON_PROPERTY_DISPLAY_NAME,
  SearchableDatabase.JSON_PROPERTY_LOCATION,
  SearchableDatabase.JSON_PROPERTY_MATCH_RT_OF_REFERENCE_SPECTRA,
  SearchableDatabase.JSON_PROPERTY_DATABASE_ID,
  SearchableDatabase.JSON_PROPERTY_CUSTOM_DB,
  SearchableDatabase.JSON_PROPERTY_SEARCHABLE,
  SearchableDatabase.JSON_PROPERTY_DB_DATE,
  SearchableDatabase.JSON_PROPERTY_DB_VERSION,
  SearchableDatabase.JSON_PROPERTY_UPDATE_NEEDED,
  SearchableDatabase.JSON_PROPERTY_NUMBER_OF_STRUCTURES,
  SearchableDatabase.JSON_PROPERTY_NUMBER_OF_FORMULAS,
  SearchableDatabase.JSON_PROPERTY_NUMBER_OF_REFERENCE_SPECTRA,
  SearchableDatabase.JSON_PROPERTY_ERROR_MESSAGE
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0")
public class SearchableDatabase {
  public static final String JSON_PROPERTY_DISPLAY_NAME = "displayName";
  @jakarta.annotation.Nullable
  private String displayName;

  public static final String JSON_PROPERTY_LOCATION = "location";
  @jakarta.annotation.Nullable
  private String location;

  public static final String JSON_PROPERTY_MATCH_RT_OF_REFERENCE_SPECTRA = "matchRtOfReferenceSpectra";
  @jakarta.annotation.Nullable
  private Boolean matchRtOfReferenceSpectra = false;

  public static final String JSON_PROPERTY_DATABASE_ID = "databaseId";
  @jakarta.annotation.Nonnull
  private String databaseId;

  public static final String JSON_PROPERTY_CUSTOM_DB = "customDb";
  @jakarta.annotation.Nonnull
  private Boolean customDb;

  public static final String JSON_PROPERTY_SEARCHABLE = "searchable";
  @jakarta.annotation.Nonnull
  private Boolean searchable;

  public static final String JSON_PROPERTY_DB_DATE = "dbDate";
  @jakarta.annotation.Nullable
  private String dbDate;

  public static final String JSON_PROPERTY_DB_VERSION = "dbVersion";
  @jakarta.annotation.Nullable
  private Integer dbVersion;

  public static final String JSON_PROPERTY_UPDATE_NEEDED = "updateNeeded";
  @jakarta.annotation.Nonnull
  private Boolean updateNeeded;

  public static final String JSON_PROPERTY_NUMBER_OF_STRUCTURES = "numberOfStructures";
  @jakarta.annotation.Nullable
  private Long numberOfStructures;

  public static final String JSON_PROPERTY_NUMBER_OF_FORMULAS = "numberOfFormulas";
  @jakarta.annotation.Nullable
  private Long numberOfFormulas;

  public static final String JSON_PROPERTY_NUMBER_OF_REFERENCE_SPECTRA = "numberOfReferenceSpectra";
  @jakarta.annotation.Nullable
  private Long numberOfReferenceSpectra;

  public static final String JSON_PROPERTY_ERROR_MESSAGE = "errorMessage";
  @jakarta.annotation.Nullable
  private String errorMessage;

  public SearchableDatabase() {
  }

  public SearchableDatabase displayName(@jakarta.annotation.Nullable String displayName) {
    
    this.displayName = displayName;
    return this;
  }

  /**
   * display name of the database  Should be short
   * @return displayName
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_DISPLAY_NAME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getDisplayName() {
    return displayName;
  }


  @JsonProperty(JSON_PROPERTY_DISPLAY_NAME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setDisplayName(@jakarta.annotation.Nullable String displayName) {
    this.displayName = displayName;
  }

  public SearchableDatabase location(@jakarta.annotation.Nullable String location) {
    
    this.location = location;
    return this;
  }

  /**
   * Storage location of user database  Might be NULL for non-user databases or if default location is used.
   * @return location
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_LOCATION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getLocation() {
    return location;
  }


  @JsonProperty(JSON_PROPERTY_LOCATION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setLocation(@jakarta.annotation.Nullable String location) {
    this.location = location;
  }

  public SearchableDatabase matchRtOfReferenceSpectra(@jakarta.annotation.Nullable Boolean matchRtOfReferenceSpectra) {
    
    this.matchRtOfReferenceSpectra = matchRtOfReferenceSpectra;
    return this;
  }

  /**
   * Indicates whether this database shall be used to use retention time information for library matching.  Typically used for in-house spectral libraries that have been measured on
   * @return matchRtOfReferenceSpectra
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MATCH_RT_OF_REFERENCE_SPECTRA)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean isMatchRtOfReferenceSpectra() {
    return matchRtOfReferenceSpectra;
  }


  @JsonProperty(JSON_PROPERTY_MATCH_RT_OF_REFERENCE_SPECTRA)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMatchRtOfReferenceSpectra(@jakarta.annotation.Nullable Boolean matchRtOfReferenceSpectra) {
    this.matchRtOfReferenceSpectra = matchRtOfReferenceSpectra;
  }

  public SearchableDatabase databaseId(@jakarta.annotation.Nonnull String databaseId) {
    
    this.databaseId = databaseId;
    return this;
  }

  /**
   * A unique identifier or name of the database.  Should only contain file path and url save characters  For user databases this is usually the file name.
   * @return databaseId
   */
  @jakarta.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_DATABASE_ID)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getDatabaseId() {
    return databaseId;
  }


  @JsonProperty(JSON_PROPERTY_DATABASE_ID)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setDatabaseId(@jakarta.annotation.Nonnull String databaseId) {
    this.databaseId = databaseId;
  }

  public SearchableDatabase customDb(@jakarta.annotation.Nonnull Boolean customDb) {
    
    this.customDb = customDb;
    return this;
  }

  /**
   * Indicates whether the database is a user managed custom database or if it is a  database that is included in SIRIUS which cannot be modified.
   * @return customDb
   */
  @jakarta.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_CUSTOM_DB)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Boolean isCustomDb() {
    return customDb;
  }


  @JsonProperty(JSON_PROPERTY_CUSTOM_DB)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setCustomDb(@jakarta.annotation.Nonnull Boolean customDb) {
    this.customDb = customDb;
  }

  public SearchableDatabase searchable(@jakarta.annotation.Nonnull Boolean searchable) {
    
    this.searchable = searchable;
    return this;
  }

  /**
   * True when this database can be used as a search parameter.  False if the database is just an additional filter that can be applied after search.
   * @return searchable
   */
  @jakarta.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_SEARCHABLE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Boolean isSearchable() {
    return searchable;
  }


  @JsonProperty(JSON_PROPERTY_SEARCHABLE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setSearchable(@jakarta.annotation.Nonnull Boolean searchable) {
    this.searchable = searchable;
  }

  public SearchableDatabase dbDate(@jakarta.annotation.Nullable String dbDate) {
    
    this.dbDate = dbDate;
    return this;
  }

  /**
   * Date on which the data was imported / database was created.
   * @return dbDate
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_DB_DATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getDbDate() {
    return dbDate;
  }


  @JsonProperty(JSON_PROPERTY_DB_DATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setDbDate(@jakarta.annotation.Nullable String dbDate) {
    this.dbDate = dbDate;
  }

  public SearchableDatabase dbVersion(@jakarta.annotation.Nullable Integer dbVersion) {
    
    this.dbVersion = dbVersion;
    return this;
  }

  /**
   * database schema version
   * @return dbVersion
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_DB_VERSION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getDbVersion() {
    return dbVersion;
  }


  @JsonProperty(JSON_PROPERTY_DB_VERSION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setDbVersion(@jakarta.annotation.Nullable Integer dbVersion) {
    this.dbVersion = dbVersion;
  }

  public SearchableDatabase updateNeeded(@jakarta.annotation.Nonnull Boolean updateNeeded) {
    
    this.updateNeeded = updateNeeded;
    return this;
  }

  /**
   * If true the database version is outdated and the database needs to be updated or re-imported before it can be used.
   * @return updateNeeded
   */
  @jakarta.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_UPDATE_NEEDED)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Boolean isUpdateNeeded() {
    return updateNeeded;
  }


  @JsonProperty(JSON_PROPERTY_UPDATE_NEEDED)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setUpdateNeeded(@jakarta.annotation.Nonnull Boolean updateNeeded) {
    this.updateNeeded = updateNeeded;
  }

  public SearchableDatabase numberOfStructures(@jakarta.annotation.Nullable Long numberOfStructures) {
    
    this.numberOfStructures = numberOfStructures;
    return this;
  }

  /**
   * Number of unique compounds available in this database.
   * @return numberOfStructures
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_NUMBER_OF_STRUCTURES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Long getNumberOfStructures() {
    return numberOfStructures;
  }


  @JsonProperty(JSON_PROPERTY_NUMBER_OF_STRUCTURES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setNumberOfStructures(@jakarta.annotation.Nullable Long numberOfStructures) {
    this.numberOfStructures = numberOfStructures;
  }

  public SearchableDatabase numberOfFormulas(@jakarta.annotation.Nullable Long numberOfFormulas) {
    
    this.numberOfFormulas = numberOfFormulas;
    return this;
  }

  /**
   * Number of different molecular formulas available in this database.
   * @return numberOfFormulas
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_NUMBER_OF_FORMULAS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Long getNumberOfFormulas() {
    return numberOfFormulas;
  }


  @JsonProperty(JSON_PROPERTY_NUMBER_OF_FORMULAS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setNumberOfFormulas(@jakarta.annotation.Nullable Long numberOfFormulas) {
    this.numberOfFormulas = numberOfFormulas;
  }

  public SearchableDatabase numberOfReferenceSpectra(@jakarta.annotation.Nullable Long numberOfReferenceSpectra) {
    
    this.numberOfReferenceSpectra = numberOfReferenceSpectra;
    return this;
  }

  /**
   * Number of reference spectra available in this database
   * @return numberOfReferenceSpectra
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_NUMBER_OF_REFERENCE_SPECTRA)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Long getNumberOfReferenceSpectra() {
    return numberOfReferenceSpectra;
  }


  @JsonProperty(JSON_PROPERTY_NUMBER_OF_REFERENCE_SPECTRA)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setNumberOfReferenceSpectra(@jakarta.annotation.Nullable Long numberOfReferenceSpectra) {
    this.numberOfReferenceSpectra = numberOfReferenceSpectra;
  }

  public SearchableDatabase errorMessage(@jakarta.annotation.Nullable String errorMessage) {
    
    this.errorMessage = errorMessage;
    return this;
  }

  /**
   * Error message if the database could not be loaded
   * @return errorMessage
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ERROR_MESSAGE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getErrorMessage() {
    return errorMessage;
  }


  @JsonProperty(JSON_PROPERTY_ERROR_MESSAGE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setErrorMessage(@jakarta.annotation.Nullable String errorMessage) {
    this.errorMessage = errorMessage;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SearchableDatabase searchableDatabase = (SearchableDatabase) o;
    return Objects.equals(this.displayName, searchableDatabase.displayName) &&
        Objects.equals(this.location, searchableDatabase.location) &&
        Objects.equals(this.matchRtOfReferenceSpectra, searchableDatabase.matchRtOfReferenceSpectra) &&
        Objects.equals(this.databaseId, searchableDatabase.databaseId) &&
        Objects.equals(this.customDb, searchableDatabase.customDb) &&
        Objects.equals(this.searchable, searchableDatabase.searchable) &&
        Objects.equals(this.dbDate, searchableDatabase.dbDate) &&
        Objects.equals(this.dbVersion, searchableDatabase.dbVersion) &&
        Objects.equals(this.updateNeeded, searchableDatabase.updateNeeded) &&
        Objects.equals(this.numberOfStructures, searchableDatabase.numberOfStructures) &&
        Objects.equals(this.numberOfFormulas, searchableDatabase.numberOfFormulas) &&
        Objects.equals(this.numberOfReferenceSpectra, searchableDatabase.numberOfReferenceSpectra) &&
        Objects.equals(this.errorMessage, searchableDatabase.errorMessage);
  }

  @Override
  public int hashCode() {
    return Objects.hash(displayName, location, matchRtOfReferenceSpectra, databaseId, customDb, searchable, dbDate, dbVersion, updateNeeded, numberOfStructures, numberOfFormulas, numberOfReferenceSpectra, errorMessage);
  }

  @Override
  public String toString() {
    return Optional.ofNullable(getDisplayName()).orElse(getDatabaseId());
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

